<div class="panes_vertical">
	<div class="box">	
		<form method="post" action="<{$APPLICATION_URL}>/Admin/Tasks/searchDeal" name="frmForm" enctype="multipart/form-data">
			<fieldset>
				<legend>Tìm deal</legend>															
				
				<p>
					<label>Tên groupon:</label>
					<input type='text' id='groupon_name' name='groupon_name' value='<{$groupon_name}>' class="textfield" style="width: 50%;" max-length="100">					
				</p>
				<p>
					<label>Ngày bắt đầu:</label>
                    <input readonly="readonly"  class="date" type="text" value="<{ $started_deal }>" style="width: 201px;" id="started_deal" name="started_deal">
				</p>
            	<p>
					<label>Ngày kết thúc:</label>
                    <input readonly="readonly"  class="date" type="text" value="<{ $expired_deal }>" style="width: 201px;" id="expired_deal" name="expired_deal">
				</p>
				<p>
					<label>Danh mục:</label>
					<select name="category">
						<option value="">Tất cả</option>
							<{foreach from=$categoryList item=item}>
								<option value="<{$item->id}>" <{if $item->id == $category}>selected<{/if}>><{$item->name}></option>
							<{/foreach}>
					</select>
				</p>
				<p>
				<label>Tình trạng</label>
				<select name="deal_status">
					<option value="-1">Tất cả</option>
						<{foreach from=$dealStatusList item=item key=key}>
							<option value="<{$key}>" <{if $key == $deal_status}>selected<{/if}>><{$item}></option>
						<{/foreach}>
				</select>
				</p>	 
				<p>
					<input type="submit" name="submit" class="button" value="Tìm"  />
					<input type="reset" name="reset" class="button" value=" Reset " />
				</p>
			</fieldset>
		</form>
		<{if $itemList|@count > 0}>
		<table border="0" cellpadding="0" cellspacing="0" class="grid_table wf">
			<tr>
				<th width="40">STT</th>
				<th width="120">Tên Groupon</th>
				<th width="120">Ngày bắt đầu</th>
				<th width="120">Ngày kết thúc</th>
				<th width="120">Giá bán</th>
				<th width="120">Giá gốct</th>
				<th width="120">Thể loại</th>
				<th width="120">Tình trạng</th>
			</tr>
				
				<{foreach from=$itemList item=item name='items'}>
				
				<tr>
					<td><{$smarty.foreach.items.index+1}></td>
					<td><{$item.groupon_name}></td>
					<td><{$item.started_deal}></td>
					<td><{$item.expired_deal}></td>
					<td><{$item.sale_price|number_format}></td>
					<td><{$item.original_price|number_format}></td>
					<td><{$item.category_name}></td>
					<td><{$dealEntity->getStatusName($item.deal_status)}></td>			
				</tr>
				<{/foreach}>
				
		</table>
		<{else}>
		<h1 align="center">Không tìm thấy!</h1>
		<{/if}>
	</div>
</div>

<script type="text/javascript">
    function formSubmit()
    {
    	var theform = document.frmForm;
    	theform.actionForm.value ='Tìm';
    	theform.submit();
    	return true;
    }
    </script>